package com.mojo.mybatis.controller;

import com.github.pagehelper.PageHelper;
import com.mojo.mybatis.pojo.BackstageUser;
import com.mojo.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author <a href="mailto:sjj@jianzhimao.com">mojo</a>
 * copyright (C), 2013-2022, 广州九尾信息科技有限公司
 * @date 2022/3/14 15:38
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/user/{id}")
    public BackstageUser getUser(@PathVariable Integer id) {
        return userService.getUser(id);
    }
    @RequestMapping("user")
    public List<BackstageUser> pageUser(@RequestParam Integer page) {
        return userService.pageUser(page);
    }
}
